//两个数组，每个数组里乱序的至少五个数（两个数组里有重复数字），然后从小到大存放到第三个数组里，输出

public class Test {
    public static void main(String[] args) {
        int[] arr1 = {9, 8, 3, 5, 2, 4};
        int[] arr2 = {4, 6, 7, 8, 1, 9};
        int[] arr= new int[arr1.length + arr2.length];
        for (int i = 0; i < arr1.length; i++) {
            arr[i] = arr1[i];
        }
        for (int j = 0; j < arr2.length; j++) {
            arr[arr1.length +j] = arr2[j];
        }
        bubbleSort(arr);
        printArray(arr);
    }


    public static void printArray(int[] arr) {
        for (int i = 0; i < arr.length; i++) {
            System.out.printf(arr[i] + "");
        }
        System.out.print("\n");
    }


    public static void bubbleSort(int[] arr) {
        for (int i = 0; i < arr.length - 1; i++) {
            for (int j = 0; j < arr.length - i - 1; j++) {
                if (arr[j] > arr[j + 1]) {
                    int temp = arr[j];
                    arr[j] = arr[j + 1];
                    arr[j + 1] = temp;
                }
            }
            printArray(arr);
        }
    }
}


